﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Bootstrapper.cs" company="">
//   
// </copyright>
// <summary>
//   bootstrapper.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using DAL;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
using Repositories;
using Web;
using Services;
using ServiceContracts;

namespace Witcraft.Halcyone.Administration.Web
{
    /// <summary>
    /// bootstrapper.
    /// </summary>
    public class Bootstrapper
    {
        public void Run()
        {
            IUnityContainer container = new UnityContainer();
            container.RegisterType<INorthwindRepository, NorthwindEntities>();
            container.RegisterType<INorthwindService, NorthwindService>();
            container.RegisterType<IServiceLocator, UnityServiceLocatorAdapter>(new ContainerControlledLifetimeManager());
            ServiceLocator.SetLocatorProvider(() => container.Resolve<IServiceLocator>());
        }
    }
}